#include <iostream>
#include <fstream>
using std::cout;
using std::endl;
using std::cerr;
using std::fstream;


void test(){
    fstream fs("1.txt");
    if(!fs.good()){
        cout << "eorror"<< endl;
        //fs.clear();
        //exit(-1);
    }
    fs.seekg(0,std::ios::end); 
    //cout << "ok"<<endl;
    size_t index = fs.tellg();
    char * p = new char [index+1]();
    fs.seekg(0);
    fs.read(p,index);
    cout << p <<endl;
    delete [] p;
    p = nullptr;

}

int main()
{
    test();
    return 0;
}

